package com.zxw.设计模式.行为型模式.观察者模式.摇号应用实例.service.impl;

/**
 * @projectName: util-cloud
 * @package: com.zxw.设计模式.行为型模式.观察者模式.摇号应用实例.service.impl
 * @className: DrawHouseServiceImpl
 * @author: zhangxuewei
 * @description: 摇号服务类
 * @date: 2023/10/9 14:46
 * @version: 1.0
 */
public class DrawHouseServiceImpl {

    // 摇号
    public String lots(String userId) {
        System.out.println(userId + "-hash_code:" + userId.hashCode());
        if (userId.hashCode() % 2 == 0)
            return "恭喜" + userId + "本次摇号中签！";
        else
            return "很遗憾" + userId + "本次摇号没有中签！";
    }

}
